<?php
if (!isset($_SESSION))
    session_start();

        $postVars = array(
          0 => "supplierType",
          1 => "roomRateKey",
          2 => "roomRateCode",
          3 => "roomTypeCode",
          4 => "hotelImage",
          5 => "hotelName",
          6 => "roomDescription",
          7 => "total",
          8 => "averageRate"
        );

		// Checks for post variable integrity
        for ($i = 0; $i < count($postVars); $i++) {
            if (!isset($_POST[$postVars[$i]])) {
                header( "Location: index.php" );
                exit();
                break;
            }
        }	
	
	
if (empty($_SESSION['logged_bool'])) {
    $_SESSION['logged_bool'] = false;
}

/*
 * If user is not logged in the following code sends him to the login page
 * Together with all the variables in the _POST superglobal 
 */
if ($_SESSION['logged_bool'] == false) {
    /* Copy _POST contents to _SESSION */
    $_SESSION['login_guard']['postcontents'] = $_POST;
    $_SESSION['currentPage'] = $_POST['currentPage'];
    header('Location: login.php');
    exit();
}
?>
﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>EAN API TEST</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
        <link href="css/widget.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/swfobject/swfobject.js"></script>
        <script type="text/javascript">
            var flashvars = {};
            flashvars.cssSource = "css/piecemaker.css";
            flashvars.xmlSource = "piecemaker.xml";

            var params = {};
            params.play = "true";
            params.menu = "false";
            params.scale = "showall";
            params.wmode = "transparent";
            params.allowfullscreen = "true";
            params.allowscriptaccess = "always";
            params.allownetworking = "all";

            swfobject.embedSWF('piecemaker.swf', 'piecemaker', '960', '440', '10', null, flashvars,
            params, null);
        </script>
        <script language="javascript" type="text/javascript">
            function clearText(field)
            {
                if (field.defaultValue == field.value) field.value = '';
                else if (field.value == '') field.value = field.defaultValue;
            }
        </script>
        <script type="text/javascript">
            function add_room()
            {
                for(i=2;i<=8;i++)
                {
                    if(document.getElementById('room'+i).style.display=="none")
                    {
                        document.getElementById('room'+i).style.display="inline"
                        break;
                    }

                }


            }
        </script>
        <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/ddsmoothmenu.js">

            /***********************************************
             * Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
             * This notice MUST stay intact for legal use
             * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
             ***********************************************/

        </script>

        <script type="text/javascript">

            ddsmoothmenu.init({
                mainmenuid: "templatemo_menu", //menu DIV id
                orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
                classname: 'ddsmoothmenu', //class added to menu's outer DIV
                //customtheme: ["#1c5a80", "#18374a"],
                contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
            })

        </script>

        <style type="text/css">
            .row
            {
                background:#D6D6CE;


            }


            .roomTitle
            {
                border:1px solid #000000;
                background-color:#D6D6CE;
                color:#000;
                padding:3px;

            }

            #booking_step1
            {
                width:100%;
                background-color:#3D3D3A;

            }
            #booking_step1 td
            {
                color:#FFF;
                padding:5px;
            }

            #booking_step2
            {
                width:100%;
                background-color:#3D3D3A;

            }
            #booking_step2 td
            {
                color:#FFF;
                padding:5px;
            }
            .active
            {
                display:block;

            }
            .inactive
            {
                display:none;
            }
            #booking_page
            {
                background:url(./images/templatemo_middle.jpg);

            }
            #booking_page h2 {
                font-size: 21px;
                margin: 0 0 0px;
            }

            #step_1
            {
                height:50px;
            }

            #step_2
            {
                height:50px;
            }
            .step_active
            {
                background:url(./images/booking_step_active.png);
                background-size:100% 100%;
            }
            .step_inactive
            {
                background:url(./images/booking_step_inactive.png);
                opacity:0.6;
                background-size:100% 100%;
            }
            .rounded
            {
                border-radius:5px;
            }
            .error
            {
                color:#FF0000;
                padding:5px;
            }
            input,textarea
            {
                border-radius:5px;
                border-color:#000;
            }
            .bookingPage_right
            {

                width:300px;
                padding:10px;
                vertical-align:top;
            }
            .bookingPage_left
            {

                width:600px;
                padding:10px;

            }
            .checkOutInfo
            {
                background: url(./images/templatemo_middle.jpg);
                padding: 5px;

            }
            .colored
            {
                background-color:#D6D6CE;
            }
            .colored h4
            {
                padding:5px;
            }

            .borderedItems
            {
                border: 1px solid #000000;
                margin-bottom: 5px;
                margin-top: 5px;
            }
        </style>
        <?php
        require('../../Smarty/libs/Smarty.class.php');

        $smarty = new Smarty;

        $smarty->setTemplateDir('./smarty/templates/');
        $smarty->setCompileDir('./smarty/templates_c/');
        $smarty->setConfigDir('./smarty/configs/');
        $smarty->setCacheDir('./smarty/cache/');



        $status = $_SESSION['logged_bool'];

        $smarty->assign("logged", $status);


        /*
         * Copy session contents to the _POST superglobal IF the currentPage
         * Session variable is set
         */
        if ((!empty($_SESSION['currentPage'])) && ($_SESSION['currentPage'] == 'bookingPage.php')) {
            $_POST = $_SESSION['login_guard']['postcontents'];
        }

        if ((!empty($_SESSION['book_guard']['postcontents']['currentPage'])) && ($_SESSION['book_guard']['postcontents']['currentPage'] == 'bookingPage.php')) {
            $_POST = $_SESSION['book_guard']['postcontents'];
            unset($_SESSION['book_guard']);
        }
        ?>
    </head>


    <body>
        <?php
        $smarty->display('header.tpl');
        
        ?>
        <?php
        if (isset($_SESSION['currentPage'])) {
            /* Destroy for clean-up reasons */
            unset($_SESSION['currentPage']);
        }


        ?>
        <div align="center">
            <table>
                <tr>
                    <td class="bookingPage_left">

                        <form action="book.php" method="post" onsubmit="return validateForm()" >
                            <div id="booking_page" style="width:100%;padding:5px;">
                                <table width="100%">
                                    <tr>
                                        <td  id="step_1" class="step_active" align="center">
                                            Step 1
                                        </td>
                                        <td  id="step_2" class="step_inactive" align="center">
                                            Step 2
                                        </td>
                                    </tr>
                                </table>
                                <div  id="booking_step1" class="active">
                                    <table width="100%" cellspacing="0">
                                        <tr class="row">
                                            <td>
                                                <h2 style="color:#000;">
                                                    Guest Details
                                                </h2>
                                            </td>
                                        </tr>
                                    </table>
                                    <?php for ($i = 1; $i <= $_SESSION["roomsNumber"]; $i++): ?>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <h5 class="roomTitle"> 
                                                        Room <?php echo $i; ?>: Adults: <?php echo $_SESSION["roomsData"][$i]["adults"]; ?> Children: <?php echo $_SESSION["roomsData"][$i]["childrenNr"]; ?>
                                                    </h5>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label>
                                                           First Name
                                                    </label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input id="guest.firstName<?php echo $i; ?>.continue" type="hidden" value="0" />
                                                    <input type="text" value="<?php if (!empty($_POST['guest_firstName' . $i])) { echo $_POST['guest_firstName' . $i]; } ?>" maxlength="100" name="guest.firstName<?php echo $i; ?>" onBlur="checkNameValidity(this,'errorFirstName<?php echo $i; ?>','guest.firstName<?php echo $i; ?>.continue')" <?php if (!empty($_POST['guest_firstName' . $i])):?>onLoad="checkNameValidity(this,'errorFirstName<?php echo $i; ?>','guest.firstName<?php echo $i; ?>.continue')"<?php endif; ?>/>
                                                    <div id="errorFirstName<?php echo $i; ?>" class="error">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label>
                                                           Last Name
                                                    </label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input id="guest.lastName<?php echo $i; ?>.continue" type="hidden" value="0" />
                                                    <input type="text" value="<?php if (!empty($_POST['guest_lastName' . $i])) { echo $_POST['guest_lastName' . $i]; } ?>" maxlength="100" name="guest.lastName<?php echo $i; ?>" onBlur="checkNameValidity(this,'errorLastName<?php echo $i; ?>','guest.lastName<?php echo $i; ?>.continue')" <?php if (!empty($_POST['guest_lastName' . $i])):?>onLoad="checkNameValidity(this,'errorLastName<?php echo $i; ?>','guest.lastName<?php echo $i; ?>.continue')"<?php endif; ?>/>
                                                    <div id="errorLastName<?php echo $i; ?>" class="error">
                                                    </div>
                                                </td>
                                            </tr>
                                            <input type="hidden" value="NS" name="rooms<?php echo $i; ?>.smokingPreferenceId" />
                                        </table>
                                    <?php endfor; ?>
                                    <table width="100%">
                                        <tr class="row" >
                                            <td>
                                                <h2 style="color:#000;" >
                                                    Contact Details
                                                </h2>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>
                                                    We require a valid email address to contact you with the details of your booking.
                                                </p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Email Address
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="contactDetails.emaiAddress.continue" type="hidden" value="<?php if (!empty($_POST['contactDetails_email'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input id='email1' type="text" value="<?php if (!empty($_POST['contactDetails_email'])) { echo $_POST['contactDetails_email'];} ?>" maxlength="100" name="contactDetails.email" onBlur="checkEmailValidity(this,'emailError','contactDetails.emaiAddress.continue')" <?php if (!empty($_POST['contactDetails_email'])):?>onLoad="checkEmailValidity(this,'emailError','contactDetails.emaiAddress.continue')"<?php endif; ?>/>
                                                <div  id="emailError" class="error">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Confirm Email Address
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="contactDetails.confirmEmailAddress.continue" type="hidden" value="<?php if (!empty($_POST['contactDetails_confirmEmail'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input type="text" id="email2" value="<?php if (!empty($_POST['contactDetails_confirmEmail'])) { echo $_POST['contactDetails_confirmEmail']; } ?>" maxlength="100" name="contactDetails.confirmEmail" onBlur="emailMatch('email1','email2','confirmEmailError','contactDetails.confirmEmailAddress.continue')" <?php if (!empty($_POST['contactDetails_confirmEmail'])):?>onLoad="emailMatch('email1','email2','confirmEmailError','contactDetails.confirmEmailAddress.continue')"<?php endif; ?> />
                                                <div class="error" id="confirmEmailError">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>
                                                    Needed if there are questions about your reservation.
                                                </p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Phone Number:
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="contactDetails.phoneNumber.continue" type="hidden" value="<?php if (!empty($_POST['contactDetails_phoneNumber'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input type="text" value="<?php if (!empty($_POST['contactDetails_phoneNumber'])) { echo $_POST['contactDetails_phoneNumber']; } ?>" maxlength="16" name="contactDetails.phoneNumber" onBlur="checkPhoneValidity(this,'phoneError','contactDetails.phoneNumber.continue')" <?php if (!empty($_POST['contactDetails_phoneNumber'])):?>onLoad="checkPhoneValidity(this,'phoneError','contactDetails.phoneNumber.continue')"<?php endif; ?>/>
                                                <div class="error" id="phoneError">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <input id="go_to_step2" type="hidden" value="stop" />
                                                <button  value="Continue" onClick="chechFileldsValidityStep1();switch_step(1,2)"  name="nextStep" type="button">
                                                    Continue
                                                </button>
                                            </td>
                                        </tr>
                                    </table>
                                </div>

                                <div id="booking_step2" class="inactive">
                                    <table width="100%" cellspacing="0" border="0">
                                        <tr class="row">
                                            <td>
                                                <h2 style="color:#000;">
                                                    Credit Card Information
                                                </h2>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Card Type:
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="creditCardInformation.cardType.continue" type="hidden" value="0" />
                                                <select name="creditCardInformation.cardType" onChange="checkCardType(this,'erorCardType','creditCardInformation.cardType.continue')" />
                                                <option value="VI">Visa</option>
                                                <option value="AX">American Express</option>
                                                <option value="MC">Master Card</option>
                                                <option value="" selected="selected">- Select Your Card Type -</option>
                                                </select>
                                                <div class="error" id="erorCardType">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Card Number
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="creditCardInformation.creditCardNumber.continue" type="hidden" value="0" autocomplete="off" />
                                                <input maxlength="100" name="creditCardInformation.cardNumber" autocomplete="off" type="text" onBlur="checkCreditCardNumber(this,'creditCardError','creditCardInformation.creditCardNumber.continue')" />
                                                <div class="error" id="creditCardError">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Cardholder First Name
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="creditCardInformation.cardHolderFirstName.continue" type="hidden" value="<?php if (!empty($_POST['cerditCardInformation_cardHolderFirstName'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input maxlength="100" name="cerditCardInformation.cardHolderFirstName" value="<?php if (!empty($_POST['cerditCardInformation_cardHolderFirstName'])) { echo $_POST['cerditCardInformation_cardHolderFirstName']; } ?>" type="text" onBlur="checkNameValidity(this,'errorCardHolderFirstName','creditCardInformation.cardHolderFirstName.continue')" />
                                                <div class="error" id='errorCardHolderFirstName'>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Cardholder Last Name
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="creditCardInformation.cardHolderLastName.continue" type="hidden" value="<?php if (!empty($_POST['creditCardInformation_cardHolderLastName'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input maxlength="100" name="creditCardInformation.cardHolderLastName" value="<?php if (!empty($_POST['creditCardInformation_cardHolderLastName'])) { echo $_POST['creditCardInformation_cardHolderLastName']; } ?>" type="text" onBlur="checkNameValidity(this,'errorCardHolderLastName','creditCardInformation.cardHolderLastName.continue')" />
                                                <div class="error" id="errorCardHolderLastName">
                                                </div>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>
                                                <label for="expiration-date" on>
                                                    Expiration Date
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <!--(yearobj,monthId,errorId,idValidity,idValidityYear,idValidityMonth)-->
                                                <input id="creditCardInformation.expirationDate.Month.continue" type="hidden" value="0" />
                                                <input id="creditCardInformation.expirationDate.Year.continue" type="hidden" value="0" />
                                                <input id="creditCardInformation.expirationDate.continue" type="hidden" value="0" />
                                                
                                                <select name="creditCardInformation.expirationDate.month" id='creditCardInformation.ExpirationDate.Month' onChange="checkExpirationDateMonth('creditCardInformation.expirationDate.year', 'creditCardInformation.ExpirationDate.Month', 'errorCreditCardExpirationDate', 'creditCardInformation.expirationDate.continue', 'creditCardInformation.expirationDate.Year.continue', 'creditCardInformation.expirationDate.Month.continue')">
                                                    <option value="" selected="selected">-- Month -</option>
                                                    <option value="01">01-January</option>
                                                    <option value="02">02-February</option>
                                                    <option value="03">03-March</option>
                                                    <option value="04">04-April</option>
                                                    <option value="05">05-May</option>
                                                    <option value="06">06-June</option>
                                                    <option value="07">07-July</option>
                                                    <option value="08">08-August</option>
                                                    <option value="09">09-September</option>
                                                    <option value="10">10-October</option>
                                                    <option value="11">11-November</option>
                                                    <option value="12">12-December</option>
                                                </select>

                                                <select name="creditCardInformation.expirationDate.year" id="creditCardInformation.expirationDate.year" onChange="checkExpirationDate(this,'creditCardInformation.ExpirationDate.Month', 'errorCreditCardExpirationDate', 'creditCardInformation.expirationDate.continue', 'creditCardInformation.expirationDate.Year.continue', 'creditCardInformation.expirationDate.Month.continue')" >
                                                    <option value="" selected="selected">- Year -</option>
                                                    <?php for ($year = date("Y"); $year < 18 + date("Y"); $year++): ?>
                                                        <option value="<?php echo $year; ?>"><?php echo $year; ?></option>
                                                    <?php endfor; ?>
                                                </select>
                                                <div class="error" id="errorCreditCardExpirationDate">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label for="security-code">
                                                    Security Code
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>  
                                                <input id="creditCardInformation.securityCode.continue" type="hidden" value="0" />
                                                <input maxlength="4" name="creditCardInformation.securityCode" type="text" onBlur="checkCardSecurityCode(this,'errorCardSecurityCode','creditCardInformation.securityCode.continue');" />
                                                <div class="error" id="errorCardSecurityCode">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="row">
                                                <h2 style="color:#000;">
                                                    Billing Address:
                                                </h2>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p class="checkout-info-label">
                                                    The billing address provided must match the credit card that is used to reserve your room.
                                                </p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Country
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <select name="billingAdress.country" id="country_select" class="select countries-list index" onChange="checkCountry(this,'stateField','stateLebel','billingAdress.stateField.continue')">
                                                    <?php // <editor-fold defaultstate="collapsed" desc="Country Select Values">  ?>
                                                                                                        <option value="AF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AF') {
                                                        echo ' selected="selected"';
                                                    } ?> >Afghanistan</option>
                                                                                                        <option value="AX"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AX') {
                                                        echo ' selected="selected"';
                                                    } ?>>Aland Islands</option>
                                                                                                        <option value="AL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AL') {
                                                        echo ' selected="selected"';
                                                    } ?>>Albania</option>
                                                                                                        <option value="DZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'DZ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Algeria</option>
                                                                                                        <option value="AS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AS') {
                                                        echo ' selected="selected"';
                                                    } ?>>American Samoa</option>
                                                                                                        <option value="AD"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AD') {
                                                        echo ' selected="selected"';
                                                    } ?>>Andorra</option>
                                                                                                        <option value="AO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AO') {
                                                        echo ' selected="selected"';
                                                    } ?>>Angola</option>
                                                                                                        <option value="AI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AI') {
                                                        echo ' selected="selected"';
                                                    } ?>>Anguilla</option>
                                                                                                        <option value="AQ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AQ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Antarctica</option>
                                                                                                        <option value="AG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AG') {
                                                        echo ' selected="selected"';
                                                    } ?>>Antigua and Barbuda</option>
                                                                                                        <option value="AR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AR') {
                                                        echo ' selected="selected"';
                                                    } ?>>Argentina</option>
                                                                                                        <option value="AM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AM') {
                                                        echo ' selected="selected"';
                                                    } ?>>Armenia</option>
                                                                                                        <option value="AW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AW') {
                                                        echo ' selected="selected"';
                                                    } ?>>Aruba</option>
                                                                                                        <option value="AU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AU') {
                                                        echo ' selected="selected"';
                                                    } ?>>Australia</option>
                                                                                                        <option value="AT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AT') {
                                                        echo ' selected="selected"';
                                                    } ?>>Austria</option>
                                                                                                        <option value="AZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AZ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Azerbaijan</option>
                                                                                                        <option value="BS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BS') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bahamas</option>
                                                                                                        <option value="BH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BH') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bahrain</option>
                                                                                                        <option value="BD"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BD') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bangladesh</option>
                                                                                                        <option value="BB"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BB') {
                                                        echo ' selected="selected"';
                                                    } ?>>Barbados</option>
                                                                                                        <option value="BY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BY') {
                                                        echo ' selected="selected"';
                                                    } ?>>Belarus</option>
                                                                                                        <option value="BE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BE') {
                                                        echo ' selected="selected"';
                                                    } ?>>Belgium</option>
                                                                                                        <option value="BZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BZ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Belize</option>
                                                                                                        <option value="BJ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BJ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Benin</option>
                                                                                                        <option value="BM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BM') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bermuda</option>
                                                                                                        <option value="BT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BT') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bhutan</option>
                                                                                                        <option value="BO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BO') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bolivia</option>
                                                                                                        <option value="BA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BA') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bosnia and Herzegovina</option>
                                                                                                        <option value="BW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BW') {
                                                        echo ' selected="selected"';
                                                    } ?>>Botswana</option>
                                                                                                        <option value="BV"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BV') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bouvet Island</option>
                                                                                                        <option value="BR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BR') {
                                                        echo ' selected="selected"';
                                                    } ?>>Brazil</option>
                                                                                                        <option value="IO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IO') {
                                                        echo ' selected="selected"';
                                                    } ?>>British Indian Ocean Territory</option>
                                                                                                        <option value="BN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BN') {
                                                        echo ' selected="selected"';
                                                    } ?>>Brunei Darussalam</option>
                                                                                                        <option value="BG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BG') {
                                                        echo ' selected="selected"';
                                                    } ?>>Bulgaria</option>
                                                                                                        <option value="BF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BF') {
                                                        echo ' selected="selected"';
                                                    } ?>>Burkina Faso</option>
                                                                                                        <option value="KH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KH') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cambodia</option>
                                                                                                        <option value="CM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CM') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cameroon</option>
                                                                                                        <option value="CA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CA') {
                                                        echo ' selected="selected"';
                                                    } ?>>Canada</option>
                                                                                                        <option value="CV"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CV') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cape Verde</option>
                                                                                                        <option value="KY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KY') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cayman Islands</option>
                                                                                                        <option value="CF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CF') {
                                                        echo ' selected="selected"';
                                                    } ?>>Central African Republic</option>
                                                                                                        <option value="TD"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TD') {
                                                        echo ' selected="selected"';
                                                    } ?>>Chad</option>
                                                                                                        <option value="CL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CL') {
                                                        echo ' selected="selected"';
                                                    } ?>>Chile</option>
                                                                                                        <option value="CN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CN') {
                                                        echo ' selected="selected"';
                                                    } ?>>China</option>
                                                                                                        <option value="CX"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CX') {
                                                        echo ' selected="selected"';
                                                    } ?>>Christmas Island</option>
                                                                                                        <option value="CC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CC') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cocos (Keeling) Islands</option>
                                                                                                        <option value="CO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CO') {
                                                        echo ' selected="selected"';
                                                    } ?>>Colombia</option>
                                                                                                        <option value="KM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KM') {
                                                        echo ' selected="selected"';
                                                    } ?>>Comoros</option>
                                                                                                        <option value="CG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CG') {
                                                        echo ' selected="selected"';
                                                    } ?>>Congo</option>
                                                                                                        <option value="CD"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CD') {
                                                        echo ' selected="selected"';
                                                    } ?>>Congo, the Democratic Republic of the</option>
                                                                                                        <option value="CK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CK') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cook Islands (New Zealand)</option>
                                                                                                        <option value="CR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CR') {
                                                        echo ' selected="selected"';
                                                    } ?>>Costa Rica</option>
                                                                                                        <option value="CI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CI') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cote d'ivoire</option>
                                                                                                        <option value="HR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'HR') {
                                                        echo ' selected="selected"';
                                                    } ?>>Croatia</option>
                                                                                                        <option value="CU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CU') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cuba</option>
                                                                                                        <option value="CY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CY') {
                                                        echo ' selected="selected"';
                                                    } ?>>Cyprus</option>
                                                                                                        <option value="CZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CZ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Czech Republic</option>
                                                                                                        <option value="DK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'DK') {
                                                        echo ' selected="selected"';
                                                    } ?>>Denmark</option>
                                                                                                        <option value="DJ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'DJ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Djibouti</option>
                                                                                                        <option value="DM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'DM') {
                                                        echo ' selected="selected"';
                                                    } ?>>Dominica</option>
                                                                                                        <option value="DO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'DO') {
                                                        echo ' selected="selected"';
                                                    } ?>>Dominican Republic</option>
                                                                                                        <option value="EC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'EC') {
                                                        echo ' selected="selected"';
                                                    } ?>>Ecuador</option>
                                                                                                        <option value="EG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'EG') {
                                                        echo ' selected="selected"';
                                                    } ?>>Egypt</option>
                                                                                                        <option value="SV"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SV') {
                                                        echo ' selected="selected"';
                                                    } ?>>El Salvador</option>
                                                                                                        <option value="GQ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GQ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Equatorial Guinea</option>
                                                                                                        <option value="ER"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ER') {
                                                        echo ' selected="selected"';
                                                    } ?>>Eritrea</option>
                                                                                                        <option value="EE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'EE') {
                                                        echo ' selected="selected"';
                                                    } ?>>Estonia</option>
                                                                                                        <option value="ET"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ET') {
                                                        echo ' selected="selected"';
                                                    } ?>>Ethiopia</option>
                                                                                                        <option value="FK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'FK') {
                                                        echo ' selected="selected"';
                                                    } ?>>Falkland Islands</option>
                                                                                                        <option value="FO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'FO') {
                                                        echo ' selected="selected"';
                                                    } ?>>Faroe Islands</option>
                                                                                                        <option value="FJ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'FJ') {
                                                        echo ' selected="selected"';
                                                    } ?>>Fiji</option>
                                                                                                        <option value="FI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'FI') {
                                                        echo ' selected="selected"';
                                                    } ?>>Finland</option>
                                                                                                        <option value="FR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'FR') {
                                                        echo ' selected="selected"';
                                                    } ?>>France</option>
                                                                                                        <option value="GF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GF') {
                                                        echo ' selected="selected"';
                                                    } ?>>French Guiana</option>
                                                                                                        <option value="PF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PF') {
                                                        echo ' selected="selected"';
                                                    } ?>>French Polynesia</option>
                                                                                                        <option value="TF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TF') {
                                                        echo ' selected="selected"';
                                                    } ?>>French Southern Territories</option>
                                                                                                        <option value="GA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GA') {
                                                        echo ' selected="selected"';
                                                    } ?>>Gabon</option>
                                                                                                        <option value="GM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Gambia</option>
                                                                                                        <option value="GE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Georgia</option>
                                                                                                        <option value="DE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'DE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Germany</option>
                                                                                                        <option value="GH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GH') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Ghana</option>
                                                                                                        <option value="GI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GI') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Gibraltar</option>
                                                                                                        <option value="GR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Greece</option>
                                                                                                        <option value="GL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GL') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Greenland</option>
                                                                                                        <option value="GD"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GD') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Grenada</option>
                                                                                                        <option value="GP"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GP') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guadeloupe</option>
                                                                                                        <option value="GU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GU') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guam</option>
                                                                                                        <option value="GT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guatemala</option>
                                                                                                        <option value="GG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guernsey</option>
                                                                                                        <option value="GN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guinea</option>
                                                                                                        <option value="GW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GW') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guinea-Bissau</option>
                                                                                                        <option value="GY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GY') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Guyana</option>
                                                                                                        <option value="HT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'HT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Haiti</option>
                                                                                                        <option value="HM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'HM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Heard Island and McDonald Islands</option>
                                                                                                        <option value="VA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Holy See (Vatican City State)</option>
                                                                                                        <option value="HN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'HN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Honduras</option>
                                                                                                        <option value="HK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'HK') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Hong Kong</option>
                                                                                                        <option value="HU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'HU') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Hungary</option>
                                                                                                        <option value="IS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Iceland</option>
                                                                                                        <option value="IN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>India</option>
                                                                                                        <option value="ID"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ID') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Indonesia</option>
                                                                                                        <option value="IR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Iran, Islamic Republic of</option>
                                                                                                        <option value="IQ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IQ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Iraq</option>
                                                                                                        <option value="IE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Ireland</option>
                                                                                                        <option value="IM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Isle of Man</option>
                                                                                                        <option value="IL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IL') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Israel</option>
                                                                                                        <option value="IT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'IT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Italy</option>
                                                                                                        <option value="JM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'JM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Jamaica</option>
                                                                                                        <option value="JP"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'JP') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Japan</option>
                                                                                                        <option value="JE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'JE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Jersey</option>
                                                                                                        <option value="JO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'JO') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Jordan</option>
                                                                                                        <option value="KZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KZ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Kazakhstan</option>
                                                                                                        <option value="KE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Kenya</option>
                                                                                                        <option value="KI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KI') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Kiribati</option>
                                                                                                        <option value="KP"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KP') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Korea</option>
                                                                                                        <option value="KR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Korea, Republic of</option>
                                                                                                        <option value="KW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KW') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Kuwait</option>
                                                                                                        <option value="KG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Kyrgyzstan</option>
                                                                                                        <option value="LA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Lao People's Democratic Republic</option>
                                                                                                        <option value="LV"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LV') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Latvia</option>
                                                                                                        <option value="LB"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LB') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Lebanon</option>
                                                                                                        <option value="LS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Lesotho</option>
                                                                                                        <option value="LR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Liberia</option>
                                                                                                        <option value="LY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LY') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Libyan Arab Jamahiriya</option>
                                                                                                        <option value="LI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LI') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Liechtenstein</option>
                                                                                                        <option value="LT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Lithuania</option>
                                                                                                        <option value="LU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LU') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Luxembourg</option>
                                                                                                        <option value="MO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MO') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Macao</option>
                                                                                                        <option value="MK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MK') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Macedonia, the former Yugoslav Republic of</option>
                                                                                                        <option value="MG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Madagascar</option>
                                                                                                        <option value="MW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MW') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Malawi</option>
                                                                                                        <option value="MY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MY') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Malaysia</option>
                                                                                                        <option value="MV"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MV') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Maldives</option>
                                                                                                        <option value="ML"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ML') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mali</option>
                                                                                                        <option value="MT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Malta</option>
                                                                                                        <option value="MH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MH') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Marshall Islands</option>
                                                                                                        <option value="MQ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MQ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Martinique</option>
                                                                                                        <option value="MR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mauritania</option>
                                                                                                        <option value="MU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MU') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mauritius</option>
                                                                                                        <option value="YT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'YT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mayotte</option>
                                                                                                        <option value="MX"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MX') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mexico</option>
                                                                                                        <option value="FM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'FM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Micronesia, Federated States of.</option>
                                                                                                        <option value="MD"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MD') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Moldova, Republic of</option>
                                                                                                        <option value="MC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MC') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Monaco</option>
                                                                                                        <option value="MN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mongolia</option>
                                                                                                        <option value="ME"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ME') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Montenegro</option>
                                                                                                        <option value="MS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Montserrat</option>
                                                                                                        <option value="MA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Morocco</option>
                                                                                                        <option value="MZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MZ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Mozambique</option>
                                                                                                        <option value="MM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Myanmar</option>
                                                                                                        <option value="NA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Namibia</option>
                                                                                                        <option value="NR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Nauru</option>
                                                                                                        <option value="NP"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NP') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Nepal</option>
                                                                                                        <option value="NL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NL') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Netherlands</option>
                                                                                                        <option value="AN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Netherlands Antilles</option>
                                                                                                        <option value="NC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NC') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>New Caledonia</option>
                                                                                                        <option value="NZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NZ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>New Zealand</option>
                                                                                                        <option value="NI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NI') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Nicaragua</option>
                                                                                                        <option value="NE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Niger</option>
                                                                                                        <option value="NG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Nigeria</option>
                                                                                                        <option value="NU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NU') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Niue</option>
                                                                                                        <option value="NF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NF') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Norfolk Island</option>
                                                                                                        <option value="MP"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MP') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Northern Mariana Islands</option>
                                                                                                        <option value="NO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'NO') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Norway</option>
                                                                                                        <option value="OM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'OM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Oman</option>
                                                                                                        <option value="PK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PK') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Pakistan</option>
                                                                                                        <option value="PW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PW') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Palau</option>
                                                                                                        <option value="PS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Palestinian Territory, Occupied</option>
                                                                                                        <option value="PA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Panama</option>
                                                                                                        <option value="PG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Papua New Guinea</option>
                                                                                                        <option value="PY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PY') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Paraguay</option>
                                                                                                        <option value="PE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Peru</option>
                                                                                                        <option value="PH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PH') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Philippines</option>
                                                                                                        <option value="PN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Pitcairn</option>
                                                                                                        <option value="PL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PL') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Poland</option>
                                                                                                        <option value="PT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Portugal</option>
                                                                                                        <option value="PR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Puerto Rico</option>
                                                                                                        <option value="QA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'QA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Qatar</option>
                                                                                                        <option value="RE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'RE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Reunion</option>
                                                                                                        <option value="RO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'RO') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Romania</option>
                                                                                                        <option value="RU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'RU') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Russian Federation</option>
                                                                                                        <option value="RW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'RW') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Rwanda</option>
                                                                                                        <option value="BL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'BL') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Barthelemy</option>
                                                                                                        <option value="SH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SH') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Helena, Ascension and Tristan da Cunha</option>
                                                                                                        <option value="KN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'KN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Kitts and Nevis</option>
                                                                                                        <option value="LC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LC') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Lucia</option>
                                                                                                        <option value="MF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'MF') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Martin</option>
                                                                                                        <option value="PM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'PM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Pierre and Miquelon</option>
                                                                                                        <option value="VC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VC') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saint Vincent and the Grenadines</option>
                                                                                                        <option value="WS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'WS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Samoa</option>
                                                                                                        <option value="SM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>San Marino</option>
                                                                                                        <option value="ST"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ST') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Sao Tome and Principe</option>
                                                                                                        <option value="SA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Saudi Arabia</option>
                                                                                                        <option value="SN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Senegal</option>
                                                                                                        <option value="RS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'RS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Serbia</option>
                                                                                                        <option value="SC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SC') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Seychelles</option>
                                                                                                        <option value="SL"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SL') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Sierra Leone</option>
                                                                                                        <option value="SG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Singapore</option>
                                                                                                        <option value="SK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SK') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Slovakia</option>
                                                                                                        <option value="SI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SI') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Slovenia</option>
                                                                                                        <option value="SB"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SB') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Solomon Islands</option>
                                                                                                        <option value="ZA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ZA') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>South Africa</option>
                                                                                                        <option value="GS"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GS') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>South Georgia and the South Sandwich Islands</option>
                                                                                                        <option value="ES"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ES') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Spain</option>
                                                                                                        <option value="LK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'LK') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Sri Lanka</option>
                                                                                                        <option value="SR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Suriname</option>
                                                                                                        <option value="SJ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SJ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Svalbard and Jan Mayen</option>
                                                                                                        <option value="SZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SZ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Swaziland</option>
                                                                                                        <option value="SE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SE') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Sweden</option>
                                                                                                        <option value="CH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'CH') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Switzerland</option>
                                                                                                        <option value="SY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'SY') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Syrian Arab Republic</option>
                                                                                                        <option value="TW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TW') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Taiwan</option>
                                                                                                        <option value="TJ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TJ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Tajikistan</option>
                                                                                                        <option value="TZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TZ') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Tanzania, United Republic of</option>
                                                                                                        <option value="TH"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TH') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Thailand</option>
                                                                                                        <option value="TG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TG') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Togo</option>
                                                                                                        <option value="TK"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TK') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Tokelau</option>
                                                                                                        <option value="TO"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TO') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Tonga</option>
                                                                                                        <option value="TT"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TT') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Trinidad and Tobago</option>
                                                                                                        <option value="TN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TN') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Tunisia</option>
                                                                                                        <option value="TR"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TR') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Turkey</option>
                                                                                                        <option value="TM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TM') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Turkmenistan</option>
                                                                                                        <option value="TC"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TC') {
                                                                                                            echo ' selected="selected"';
                                                                                                        } ?>>Turks and Caicos Islands</option>
                                                                                                        <option value="TV"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'TV') {
                                                                                                    echo ' selected="selected"';
                                                                                                } ?>>Tuvalu</option>
                                                                                                        <option value="UG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'UG') {
                                                                                                    echo ' selected="selected"';
                                                                                                } ?>>Uganda</option>
                                                                                                        <option value="UA"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'UA') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Ukraine</option>
                                                                                                        <option value="AE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'AE') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>United Arab Emirates</option>
                                                                                                        <option value="GB"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'GB') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>United Kingdom</option>
                                                                                                        <option value="US"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'US') {
                                                                                                        echo ' selected="selected"';
                                                                                                    }
                                                                                                    else {
                                                                                                        if (empty($_POST['billingAdress_country'])) {
                                                                                                            echo ' selected="selected"';
                                                                                                        }
                                                                                                    } ?>>United States</option>
                                                                                                        <option value="UM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'UM') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>United States Minor Outlying Islands</option>
                                                                                                        <option value="UY"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'UY') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Uruguay</option>
                                                                                                        <option value="UZ"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'UZ') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Uzbekistan</option>
                                                                                                        <option value="VU"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VU') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Vanuatu</option>
                                                                                                        <option value="VE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VE') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Venezuela</option>
                                                                                                        <option value="VN"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VN') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Vietnam</option>
                                                                                                        <option value="VG"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VG') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Virgin Islands, British</option>
                                                                                                        <option value="VI"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'VI') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Virgin Islands, U.S.</option>
                                                                                                        <option value="WF"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'WF') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Wallis and Futuna</option>
                                                                                                        <option value="YE"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'YE') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Yemen</option>
                                                                                                        <option value="ZM"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ZM') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Zambia</option>
                                                                                                        <option value="ZW"<?php if (!empty($_POST['billingAdress_country']) && $_POST['billingAdress_country'] == 'ZW') {
                                                                                                        echo ' selected="selected"';
                                                                                                    } ?>>Zimbabwe</option>
                                                    <?php // </editor-fold>  ?>                                                    
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label for="street-address">
                                                    Street Address
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="billingAddress.streetAddres.part1.continue" type="hidden" value="<?php if (!empty($_POST['billingAddress_streetAddres_part1'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input maxlength="50" name="billingAddress.streetAddres.part1" type="text" value="<?php if (!empty($_POST['billingAddress_streetAddres_part1'])) { echo $_POST['billingAddress_streetAddres_part1']; } ?>" onBlur="checkStreetValidity(this,'errorStreetAddres','billingAddress.streetAddres.part1.continue')" onLoad="checkStreetValidity(this,'errorStreetAddres','billingAddress.streetAddres.part1.continue')" />
                                                <div id='errorStreetAddres' class="error"></div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type="hidden" maxlength="50" name="billingAddress.streetAddres.part2" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>City</label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="billingAdress.city.continue" type="hidden" value="<?php if (!empty($_POST['billingAddress_city'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input  maxlength="20" name="billingAddress.city" type="text" value="<?php if (!empty($_POST['billingAddress_city'])) { echo $_POST['billingAddress_city']; } ?>" onBlur="checkCityValidity(this,'errorCity','billingAdress.city.continue')" />
                                                <div id='errorCity' class="error">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label>
                                                    Postal / Zip Code
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input id="billingAdress.zipCode.continue" type="hidden" value="<?php if (!empty($_POST['billingAddress_zipCode'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <input  maxlength="20" name="billingAddress.zipCode" type="text" value="<?php if (!empty($_POST['billingAddress_zipCode'])) { echo $_POST['billingAddress_zipCode']; } ?>" onBlur="checkZipCode(this,'errorZipCode','billingAdress.zipCode.continue')" />
                                                <div class="error" id="errorZipCode">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="active" id="stateLebel">
                                            <td>
                                                <label>
                                                    State
                                                </label>
                                            </td>
                                        </tr>
                                        <tr id="stateField" class="active">
                                            <td>
                                                <input id="billingAdress.stateField.continue" type="hidden" value="<?php if (!empty($_POST['billingAddress_state'])): ?>1<? else: ?>0<?php endif; ?>" />
                                                <select name="billingAddress.state" onChange="checkState(this,'stateFieldError','billingAdress.stateField.continue')">
                                                    <?php // <editor-fold defaultstate="collapsed" desc="State Select Values">  ?>
                                                    <option value="null">- Select State -</option>
                                                    <option value="AL"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AL') { echo ' selected="selected"'; } ?>>Alabama</option>
                                                    <option value="AK"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AK') { echo ' selected="selected"'; } ?>>Alaska</option>
                                                    <option value="AS"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AS') { echo ' selected="selected"'; } ?>>American Samoa</option>
                                                    <option value="AZ"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AZ') { echo ' selected="selected"'; } ?>>Arizona</option>
                                                    <option value="AR"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AR') { echo ' selected="selected"'; } ?>>Arkansas</option>
                                                    <option value="AA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AA') { echo ' selected="selected"'; } ?>>Armed Forces Americas excluding Canada</option>
                                                    <option value="AE"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AE') { echo ' selected="selected"'; } ?>>Armed Forces EMEA and Canada</option> 
                                                    <option value="AP"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'AP') { echo ' selected="selected"'; } ?>>Armed Forces Pacific</option>
                                                    <option value="CA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'CA') { echo ' selected="selected"'; } ?>>California</option>
                                                    <option value="CO"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'CO') { echo ' selected="selected"'; } ?>>Colorado</option>
                                                    <option value="CT"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'CT') { echo ' selected="selected"'; } ?>>Connecticut</option>
                                                    <option value="DE"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'DE') { echo ' selected="selected"'; } ?>>Delaware</option> 
                                                    <option value="DC"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'DC') { echo ' selected="selected"'; } ?>>District of Columbia</option>
                                                    <option value="FM"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'FM') { echo ' selected="selected"'; } ?>>Federated States of Micronesia</option>
                                                    <option value="FL"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'FL') { echo ' selected="selected"'; } ?>>Florida</option>
                                                    <option value="GA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'GA') { echo ' selected="selected"'; } ?>>Georgia</option>
                                                    <option value="GU"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'GU') { echo ' selected="selected"'; } ?>>Guam</option>
                                                    <option value="HI"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'HI') { echo ' selected="selected"'; } ?>>Hawaii</option>
                                                    <option value="ID"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'ID') { echo ' selected="selected"'; } ?>>Idaho</option>
                                                    <option value="IL"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'IL') { echo ' selected="selected"'; } ?>>Illinois</option>
                                                    <option value="IN"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'IN') { echo ' selected="selected"'; } ?>>Indiana</option>
                                                    <option value="IA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'IA') { echo ' selected="selected"'; } ?>>Iowa</option>
                                                    <option value="KS"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'KS') { echo ' selected="selected"'; } ?>>Kansas</option>
                                                    <option value="KY"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'KY') { echo ' selected="selected"'; } ?>>Kentucky</option>
                                                    <option value="LA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'LA') { echo ' selected="selected"'; } ?>>Louisiana</option>
                                                    <option value="ME"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'ME') { echo ' selected="selected"'; } ?>>Maine</option>
                                                    <option value="MH"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MH') { echo ' selected="selected"'; } ?>>Marshall Islands</option>
                                                    <option value="MD"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MD') { echo ' selected="selected"'; } ?>>Maryland</option>
                                                    <option value="MA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MA') { echo ' selected="selected"'; } ?>>Massachusetts</option>
                                                    <option value="MI"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MI') { echo ' selected="selected"'; } ?>>Michigan</option>
                                                    <option value="MN"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MN') { echo ' selected="selected"'; } ?>>Minnesota</option>
                                                    <option value="MS"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MS') { echo ' selected="selected"'; } ?>>Mississippi</option>
                                                    <option value="MO"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MO') { echo ' selected="selected"'; } ?>>Missouri</option>
                                                    <option value="MT"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MT') { echo ' selected="selected"'; } ?>>Montana</option>
                                                    <option value="NE"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NE') { echo ' selected="selected"'; } ?>>Nebraska</option>
                                                    <option value="NV"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NV') { echo ' selected="selected"'; } ?>>Nevada</option>
                                                    <option value="NH"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NH') { echo ' selected="selected"'; } ?>>New Hampshire</option>
                                                    <option value="NJ"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NJ') { echo ' selected="selected"'; } ?>>New Jersey</option>
                                                    <option value="NM"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NM') { echo ' selected="selected"'; } ?>>New Mexico</option>
                                                    <option value="NY"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NY') { echo ' selected="selected"'; } ?>>New York</option>
                                                    <option value="NC"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'NC') { echo ' selected="selected"'; } ?>>North Carolina</option>
                                                    <option value="ND"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'ND') { echo ' selected="selected"'; } ?>>North Dakota</option>
                                                    <option value="MP"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'MP') { echo ' selected="selected"'; } ?>>Northern Mariana Islands</option>
                                                    <option value="OH"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'OH') { echo ' selected="selected"'; } ?>>Ohio</option>
                                                    <option value="OK"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'OK') { echo ' selected="selected"'; } ?>>Oklahoma</option>
                                                    <option value="OR"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'OR') { echo ' selected="selected"'; } ?>>Oregon</option>
                                                    <option value="PA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'PA') { echo ' selected="selected"'; } ?>>Pennsylvania</option>
                                                    <option value="PR"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'PR') { echo ' selected="selected"'; } ?>>Puerto Rico</option>
                                                    <option value="RI"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'RI') { echo ' selected="selected"'; } ?>>Rhode Island</option>
                                                    <option value="SC"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'SC') { echo ' selected="selected"'; } ?>>South Carolina</option>
                                                    <option value="SD"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'SD') { echo ' selected="selected"'; } ?>>South Dakota</option>
                                                    <option value="TN"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'TN') { echo ' selected="selected"'; } ?>>Tennessee</option>
                                                    <option value="TX"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'TX') { echo ' selected="selected"'; } ?>>Texas</option>
                                                    <option value="UT"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'UT') { echo ' selected="selected"'; } ?>>Utah</option>
                                                    <option value="VT"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'VT') { echo ' selected="selected"'; } ?>>Vermont</option>
                                                    <option value="VI"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'VI') { echo ' selected="selected"'; } ?>>Virgin Islands</option>
                                                    <option value="VA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'VA') { echo ' selected="selected"'; } ?>>Virginia</option>
                                                    <option value="WA"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'WA') { echo ' selected="selected"'; } ?>>Washington</option>
                                                    <option value="WV"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'WV') { echo ' selected="selected"'; } ?>>West Virginia</option>
                                                    <option value="WI"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'WI') { echo ' selected="selected"'; } ?>>Wisconsin</option>
                                                    <option value="WY"<?php if (!empty($_POST['billingAddress_state']) && $_POST['billingAddress_state'] == 'WY') { echo ' selected="selected"'; } ?>>Wyoming</option>
                                                    <?php // </editor-fold>  ?>
                                                </select>
                                                <div class="error" id='stateFieldError'>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div id="cancelationPolicy">
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <h2>Cancelation Policy</h2>
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                                <input id="termsAndConditions" name="termsAndConditions" value="true" type="checkbox" onClick="checkForm(this,'completeReservationButton')" autocomplete="off" />
                                                <label>
                                                    I agree to
                                                    <a href="http://travel.ian.com/index.jsp?pageName=userAgreement&locale=en_US&cid=xxx" target="_blank">
                                                        Terms and Conditions
                                                    </a>
                                                    and understand Cancellation Policy.
                                                </label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input name="currentPage"           type="hidden" value="bookingPage.php"/>
                                                <input name="hotelId"               type="hidden" value="<?php echo $_POST['hotelId']; ?>"/>
                                                <input name="supplierType"          type="hidden" value="<?php echo $_POST['supplierType']; ?>"/>
                                                <input name="roomRateKey"           type="hidden" value="<?php echo $_POST['roomRateKey']; ?>"/>
                                                <input name="roomRateCode"          type="hidden" value="<?php echo $_POST['roomRateCode']; ?>"/>
                                                <input name="roomTypeCode"          type="hidden" value="<?php echo $_POST['roomTypeCode']; ?>"/>
                                                <input name="hotelImage"            type="hidden" value="<?php echo $_POST['hotelImage']; ?>"/>
                                                <input name="hotelName"             type="hidden" value="<?php echo $_POST['hotelName']; ?>"/>
                                                <input name="roomDescription"       type="hidden" value="<?php echo $_POST['roomDescription']; ?>"/>
                                                <input name="averageRate"           type="hidden" value="<?php echo $_POST['averageRate']; ?>"/>
                                                <input name="total"                 type="hidden" value="<?php echo $_POST['total']; ?>"/>
                                                <input name="roomtotal"             type="hidden" value="<?php echo $_POST['roomtotal']; ?>"/>
                                                <input name="nightlyRateTotal"      type="hidden" value="<?php echo $_POST['nightlyRateTotal']; ?>"/>
                                                <input name="surchargeTotal"        type="hidden" value="<?php echo $_POST['surchargeTotal']; ?>"/>
                                                <input name="currencyCode"          type="hidden" value="<?php echo $_POST['currencyCode']; ?>"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <button id="completeReservationButton" disabled type="submit"  name="book" value="book">
                                                    Complete Reservation
                                                </button>
                                            </td>
                                        </tr>
                                    </table>

                                </div>
                            </div>
                        </form>
                    </td>
                    <td class="bookingPage_right">
                        <div class="checkOutInfo">
                            <div class="colored">
                                <h4>
                                    Your Booking Summary
                                </h4>
                            </div>
                            <div class="colored">
                                <table >
                                    <tr>
                                        <td>
                                            <?php echo '<img src="' . $_POST["hotelImage"] . '"/>'?>
                                        </td>
                                        <td>
                                            <b>
                                                <?php echo $_POST["hotelName"]?>
                                            </b>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="colored">
                                <div style="padding:5px">
                                    <b>
                                        CheckIn: <?php echo $_SESSION["checkIn"]; ?>
                                    </b>
                                </div>
                                <div style="padding:5px">
                                    <b>
                                        CheckOut: <?php echo $_SESSION["checkOut"]; ?>
                                    </b>
                                </div>
                            </div>
                            <div class="colored" style="padding: 5px;">
                                <b>
                                    <?php echo $_POST["roomDescription"] . ",Non-Smoking"; ?>
                                </b>
                            </div>
                            <div class="borderedItems colored" style="padding-right:5px;padding-left:5px;">
                                <div class="borderedItems">
                                    Total without taxes: <?php echo $_POST["nightlyRateTotal"]; ?>
                                </div>

                                <div class="borderedItems">
                                    Tax recovery charges
                                    <br />and service fees: <?php echo $_POST["surchargeTotal"]; ?>
                                </div>
                                <div class="borderedItems">
                                    <b>
                                        You will be charged a total of: <?php echo $_POST["roomtotal"]; ?>
                                    </b>
                                </div>
                            </div>
                            <div class="colored">
                                All prices are displayed in: <?php echo $_POST["currencyCode"]; ?>
                                <br />
                                You will be charged in <?php echo $_POST["currencyCode"]; ?>: <?php echo $_POST["roomtotal"]; ?>
                                <br /><br />
                                Full payment will be charged to your credit
                                card when you book this hotel. Please be aware
                                that your bank may convert the payment to your
                                local currency and charge you an additional conversion fee.
                                This means that the amount you see on your credit
                                or bank card statement may be in your local currency
                                and therefore a different figure than the Total Price
                                shown above. If you have any questions about this fee or
                                the exchange rate applied to your booking, please
                                contact your bank.
                            </div>
                            <div class="colored" >
                                <b>
                                    Please note that pressing the 'Confirm Reservation' button multiple times may result in multiple bookings,
                                    for which we, Xoomworks RO SRL, cannot be helded accounted for.
                                </b>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <script type="text/javascript">

            function replaceClass(a,b,id)
            {

                document.getElementById(id).classList.add(b);
                document.getElementById(id).classList.remove(a);
            }

            function switch_step(a,b)
            {
                if((a==1)&&(b==2)&&(document.getElementById('go_to_step2').value=='continue'))
                {
                    replaceClass('active','inactive','booking_step1');
                    replaceClass('inactive','active','booking_step2');
                    replaceClass('step_active','step_inactive','step_1');
                    replaceClass('step_inactive','step_active','step_2');
                }
                else
                {
                    alert("Please check the data again.");
                }
            }

            function checkStreetValidity(elem,id,idValidity)
            {
                var ok = false;
                var text=elem.value;
                
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text
                
                if(document.getElementById('termsAndConditions').checked == true){
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                
                if (elem.value.length == 0) {
                    ok = true;
                }
                if(ok)
                {
                    document.getElementById(id).innerHTML="Please enter your street address.";
                    elem.style.borderColor="#f00";
                    document.getElementById(idValidity).value=0;
                }
                else
                {

                    elem.style.borderColor="#000";
                    document.getElementById(id).innerHTML="";
                    document.getElementById(idValidity).value=1;

                }
            }
            
            
            
            
            
            function checkNameValidity(elem,id,idValidity) {
                var ok = false;
                var fieldIsEmpty = false;
                var leters="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
                var text=elem.value;
                
                /* Remove trailing and leading spaces */
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text

                if(document.getElementById('termsAndConditions').checked == true){
                        document.getElementById('termsAndConditions').checked = false;
                        document.getElementById('completeReservationButton').disabled = true;
                }

                for(i=0;i<elem.value.length;i++)
                {
                    if(leters.indexOf(text[i])<0)
                    {
                        ok=true;
                    }
                    //alert(i);
                }
                if (elem.value.length == 0) {
                    ok = true;
                    fieldIsEmpty = true;
                }

                if(ok)
                {
                    if (fieldIsEmpty == true) {
                        document.getElementById(id).innerHTML="Please enter your name.";
                    }
                    else {
                        document.getElementById(id).innerHTML="You have entered an invalid name. The name can not contain numbers or special chars.";
                    }
                elem.style.borderColor="#f00";
                document.getElementById(idValidity).value=0;
                } else {
                    elem.style.borderColor="#000";
                    document.getElementById(id).innerHTML="";
                    document.getElementById(idValidity).value=1;
                }
            }






            function checkPhoneValidity(elem,id,idValidity) {
                var ok=false;
                var digits="0123456789()- ";
                var text=elem.value;
                
                /* Remove trailing and leading spaces */
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text
                
                var fieldIsEmpty = false;

                if (elem.value.length <= 4 || elem.value.length >= 16) {
                    ok = true;
                    if (elem.value.length == 0){
                        fieldIsEmpty = true;
                    }
                }

                if(document.getElementById('termsAndConditions').checked == true){
                        document.getElementById('termsAndConditions').checked = false;
                        document.getElementById('completeReservationButton').disabled = true;
                }


                for(i=0;i<elem.value.length;i++)
                {
                    if(digits.indexOf(text[i])<0)
                    {
                        ok=true;
                    }
                }

                if(ok)
                {
                    if(fieldIsEmpty){
                        document.getElementById(id).innerHTML="Please enter a phone number";
                        elem.style.borderColor="#f00";
                        document.getElementById(idValidity).value=0;
                    } else {
                        document.getElementById(id).innerHTML="You have entered an invalid phone number. The phone number should have at least 5 characters and contain only digits, parantheses, spaces and dashes.";
                        elem.style.borderColor="#f00";
                        document.getElementById(idValidity).value=0;
                    }
                } else {
                   elem.style.borderColor="#000";
                    document.getElementById(id).innerHTML="";
                    document.getElementById(idValidity).value=1;
                }
            }
            
            
            

            function checkEmailValidity(elem,id,idValidity) {
                var ok=true;
                var chars="@.";
                var em=elem.value;
                
                /* Remove trailing and leading spaces */
                em = em.replace(/(^\s+|\s+$)/g,'');
                elem.value = em
                
                var email;
                email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
                if(document.getElementById('termsAndConditions').checked == true){
                        document.getElementById('termsAndConditions').checked = false;
                        document.getElementById('completeReservationButton').disabled = true;
                }
                if (!em.match(email)) {
                    ok=false;
                } else {
                    or=true;
                }
                if(!ok) {
                    document.getElementById(id).innerHTML="You have entered an invalid email address.";
                    elem.style.borderColor="#f00";
                    document.getElementById(idValidity).value=0;
                } else {
                    elem.style.borderColor="#000";
                    document.getElementById(id).innerHTML="";
                    document.getElementById(idValidity).value=1;
                }
            }
            
            
            

            function emailMatch(em1,em2,ider,idValidity) {
//                text = em2.value;
//                
//                /* Remove trailing and leading spaces */
//                text = text.replace(/(^\s+|\s+$)/g,'');
//                em2.value = text
                
                var email;
                email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
                if(!(document.getElementById(em1).value==document.getElementById(em2).value)) {
                    document.getElementById(ider).innerHTML='Email addresses don\'t match!';
                    document.getElementById(em1).style.borderColor='#f00';
                    document.getElementById(em2).style.borderColor='#f00';
                    document.getElementById(idValidity).value=0;
                } else {
                    document.getElementById(ider).innerHTML="";
                    document.getElementById(idValidity).value=1;
                    document.getElementById(em2).style.borderColor='#000';
                    if(document.getElementById(em1).value.match(email)) {
                        document.getElementById(em1).style.borderColor='#000';
                    }
                }
            }
            
            
            

            function chechFileldsValidityStep1(){
                var ok=true;
                if(document.getElementById('contactDetails.emaiAddress.continue').value==0)         ok=false;
                if(document.getElementById('contactDetails.confirmEmailAddress.continue').value==0) ok=false;
                if(document.getElementById('contactDetails.phoneNumber.continue').value==0)         ok=false;
                
                jQuery('input').each(function(index){
                    if ( jQuery(this).attr('value') == '0') {
                        jQuery(this).parent().find('input').css({'border':'2px inset #f00' });
                    }
                });
                
                if(ok==true) { 
                    jQuery('input').each(function(index){
                        jQuery(this).parent().find('input').css({'border':'2px inset #000' });
                    });
                    document.getElementById('go_to_step2').value='continue' 
                };
            }
            
            
            

            function checkCreditCardNumber(elem,errorId,idValidity){
                var ok=false;
                var digits="0123456789";
                var text=elem.value;
                
                /* Remove trailing and leading spaces */
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text
                

                if(document.getElementById('termsAndConditions').checked == true){
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }

                for(i=0;i<elem.value.length;i++){
                    if(digits.indexOf(text[i])<0){
                        ok=true;
                    }
                }
                if(text.length!=16){
                    ok=true;
                }

                if(ok==true){
                    document.getElementById('creditCardError').innerHTML="You have entered an invalid credit card number";
                    document.getElementById(idValidity).value=0;
                    elem.style.borderColor='#f00';
                } else {
                    document.getElementById('creditCardError').innerHTML="";
                    document.getElementById(idValidity).value=1;
                    elem.style.borderColor='#000';
                }
            }



            /* ---------------------------------------------------------------------------
             * CHECK MONTH 
             * ---------------------------------------------------------------------------*/
            function checkExpirationDateMonth(yearId,monthId,errorId,idValidity,idValidityYear,idValidityMonth) {
                var elMonth=document.getElementById(monthId);
                var selectedMonth=elMonth.options[elMonth.selectedIndex];
                var month, year;
                var d= new Date();
                var ok= true;
                var resetYear = false;

                window.MonthHasBeenSet = true;

                if(window.YearHasBeenSet == true) {
                    year = parseInt(document.getElementById(yearId).value);
                } else {
                    year = 0;
                }

                if(document.getElementById('termsAndConditions').checked == true){
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }

                month=parseInt(selectedMonth.value);

                if(isNaN(month)) {
                    ok = false;
                } else {
                    if (year == d.getFullYear()) {
                        if(month > d.getMonth()) {
                            if (window.YearHasBeenSet == true){ resetYear = true; console.log('entered if'); }
                            ok = true;
                        } else {
                            ok= false;
                        }
                    } else {
                        ok=true;
                    }
                }

                if(!ok && window.YearHasBeenSet == true) {
                    document.getElementById(monthId).style.borderColor='#f00';
                    document.getElementById(idValidityMonth).value=0;
                    document.getElementById(errorId).innerHTML="Invalid date.";

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity

                } else if (!ok) {
                    document.getElementById(idValidityMonth).value=0;

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity

                } else {
                    document.getElementById(monthId).style.borderColor='#000';
                    document.getElementById(idValidityMonth).value=1;
                    document.getElementById(errorId).innerHTML="";

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity

                }

                if(resetYear) {
                    document.getElementById(yearId).style.borderColor='#000';
                    document.getElementById(idValidityYear).value=1;
                    document.getElementById(errorId).innerHTML="";

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity
                }
            }


            /* ---------------------------------------------------------------------------
             * CHECK YEAR
             * ---------------------------------------------------------------------------*/
            function checkExpirationDate(yearobj,monthId,errorId,idValidity,idValidityYear,idValidityMonth) {
                var elMonth=document.getElementById(monthId);
                var selectedMonth=elMonth.options[elMonth.selectedIndex];
                var year;
                var d= new Date();
                var ok= true;
                var currentYear = d.getFullYear()

                window.YearHasBeenSet = true;

                year=yearobj.options[yearobj.selectedIndex].value;
                month=parseInt(selectedMonth.value);

                if(document.getElementById('termsAndConditions').checked == true){
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                console.log(d.getMonth()+1 + " ---- " + month);


                if(year >= currentYear) {
                    if(year == currentYear && window.MonthHasBeenSet && month < (d.getMonth()+1)) {
                        ok=false;
                    } else if (year == currentYear && window.MonthHasBeenSet && month >= (d.getMonth()+1)){
                        ok=true;
                    } else if (year == currentYear){
                        ok=true
                    } else if (year > currentYear){
                        ok=true
                    }
                } else {
                    ok = false;
                }

                if(!ok && window.MonthHasBeenSet == true) {
                    yearobj.style.borderColor="#f00";
                    document.getElementById(idValidityYear).value=0;
                    document.getElementById(errorId).innerHTML="Invalid date."

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity
                } else if (!ok) {
                    document.getElementById(idValidityYear).value=0;

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity

                } else {
                    yearobj.style.borderColor="#000";
                    document.getElementById(idValidityYear).value=1;
                    document.getElementById(errorId).innerHTML=""

                    var validity = parseInt(document.getElementById(idValidityYear).value);
                    validity = validity & parseInt(document.getElementById(idValidityMonth).value);
                    document.getElementById(idValidity).value = validity
                }
            }



            function checkCardSecurityCode(elem,errorId,idValidity) {
                var text=elem.value;
                
                /* Remove trailing and leading spaces */
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text
                
                var digits='0123456789';
                var ok= true;
                if(document.getElementById('termsAndConditions').checked == true) {
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                for(i=0;i<text.length;i++) {
                    if(!(digits.indexOf(text[i])>=0)) {
                        ok= false;
                    }
                }
                if (elem.value.length == 0) {
                    ok = false;
                }
                if(!ok) {
                    document.getElementById(errorId).innerHTML="Please enter your 3 digit credit card security code";
                    elem.style.borderColor="#f00";
                    document.getElementById(idValidity).value=0;
                } else {
                    document.getElementById(idValidity).value=1;
                    document.getElementById(errorId).innerHTML="";
                    elem.style.borderColor="#000";
                }
            }




            function checkCityValidity(elem,errorId,idValidity) {
                var text=elem.value;
                
                /* Remove trailing and leading spaces */
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text
                
                var leters=/^[a-zA-Z]+(?:[\s-][a-zA-Z]+)*$/;
                if(document.getElementById('termsAndConditions').checked == true) {
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                if(text.match(leters)) {
                    document.getElementById(idValidity).value=1
                    document.getElementById(errorId).innerHTML="";
                    elem.style.borderColor="#000";
                } else {
                    document.getElementById(idValidity).value=0
                    document.getElementById(errorId).innerHTML="You have entered an invalid city name";
                    elem.style.borderColor="#f00";
                }
            }

            function checkZipCode(elem,errorId,idValidity) {
                var numbers=/^[0-9]+$/;
                var text= elem.value;
                
                /* Remove trailing and leading spaces */
                text = text.replace(/(^\s+|\s+$)/g,'');
                elem.value = text
                
                if(document.getElementById('termsAndConditions').checked == true){
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                if (document.getElementById('country_select').value == "US") {
                    if(text.length == 5) {
                        if(text.match(numbers)) {
                            document.getElementById(errorId).innerHTML="";
                            document.getElementById(idValidity).value=1;
                            elem.style.borderColor='#000';
                        } else {
                            document.getElementById(errorId).innerHTML="You have entered an invalid US ZIP code";
                            document.getElementById(idValidity).value=0;
                            elem.style.borderColor='#f00';
                        }
                    } else {
                        document.getElementById(errorId).innerHTML="You have entered an invalid US ZIP code";
                        document.getElementById(idValidity).value=0;
                        elem.style.borderColor='#f00';
                    }
                } else {
                    if(text.match(numbers)) {
                        document.getElementById(errorId).innerHTML="";
                        document.getElementById(idValidity).value=1;
                        elem.style.borderColor='#000';
                    } else {
                        document.getElementById(errorId).innerHTML="You have entered an invalid ZIP code";
                        document.getElementById(idValidity).value=0;
                        elem.style.borderColor='#f00';
                    }
                }
            }

            function checkCountry(elem,stateFieldId,stateLabelId,stateIdValidity) {
                var country=elem.options[elem.selectedIndex].value;
                if(document.getElementById('termsAndConditions').checked == true) {
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                if(country=="US") {
                    document.getElementById(stateFieldId).classList.remove('inactive');
                    document.getElementById(stateFieldId).classList.add('active');
                    document.getElementById(stateLabelId).classList.remove('inactive');
                    document.getElementById(stateLabelId).classList.add('active');
                    document.getElementById(stateIdValidity).value=0;
                } else {
                    document.getElementById(stateFieldId).classList.remove('active');
                    document.getElementById(stateFieldId).classList.add('inactive');
                    document.getElementById(stateLabelId).classList.remove('active');
                    document.getElementById(stateLabelId).classList.add('inactive');
                    document.getElementById(stateIdValidity).value=1;
                }
            }

            function checkState(elem,errorId,idValidity) {
                if(document.getElementById('termsAndConditions').checked == true) {
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }
                if(elem.options[elem.selectedIndex].value=="") {
                    document.getElementById(errorId).innerHTML="Selecte a state!";
                    document.getElementById(idValidity).value=0;
                    elem.borderColor="#f00";
                } else {
                    document.getElementById(errorId).innerHTML="";
                    document.getElementById(idValidity).value=1;
                    elem.borderColor="#000"; 
                }
            }

            function checkForm(elem,completeRezButtonId) {
                var correct;
                correct=1;
                correct*=parseInt(document.getElementById('creditCardInformation.cardType.continue').value);
                correct*=parseInt(document.getElementById('creditCardInformation.creditCardNumber.continue').value);
                correct*=parseInt(document.getElementById('creditCardInformation.cardHolderFirstName.continue').value);
                correct*=parseInt(document.getElementById('creditCardInformation.cardHolderLastName.continue').value);
                correct*=parseInt(document.getElementById('creditCardInformation.expirationDate.continue').value);
                correct*=parseInt(document.getElementById('creditCardInformation.securityCode.continue').value);
                correct*=parseInt(document.getElementById('billingAdress.city.continue').value);
                correct*=parseInt(document.getElementById('billingAdress.zipCode.continue').value);
                correct*=parseInt(document.getElementById('billingAdress.stateField.continue').value);
                correct*=parseInt(document.getElementById('creditCardInformation.cardType.continue').value);

                jQuery('input').each(function(index){
                    if ( jQuery(this).attr('value') == '0') {
                        jQuery(this).parent().find('input, select').css({'border':'2px inset #f00' });
                    }
                });
                if(correct===1) {
                    if(elem.checked) {
                        document.getElementById(completeRezButtonId).disabled=false;
                    } else {
						document.getElementById(completeRezButtonId).disabled=true;
                    }
                } else {
                    document.getElementById(completeRezButtonId).disabled=true;
                    alert("Please check the data again.");
                    jQuery('#cancelationPolicy').next().removeAttr('checked');
                }
            }

            function checkCardType(elem,errorId,idValidity) {
                if(document.getElementById('termsAndConditions').checked == true){
                    document.getElementById('termsAndConditions').checked = false;
                    document.getElementById('completeReservationButton').disabled = true;
                }

                if(elem.options[elem.selectedIndex].value=='') {
                    document.getElementById(errorId).innerHTML="Select Your Card Type";
                    document.getElementById(idValidity).value=0;
                    elem.style.borderColor="#f00";
                } else {
                    document.getElementById(errorId).innerHTML="";
                    document.getElementById(idValidity).value=1;
                    elem.style.borderColor="#000";
                }
            }

        </script>
<?php
$smarty->display('flashyBox.tpl');
$smarty->display('footer.tpl');
?>
    </body>
</html>



